<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<#include "/include/head_common.html">
<title>字典管理</title>
    <script type="text/javascript">
        function page(n, s) {
            $("#pageNum").val(n);
            $("#pageSize").val(s);
            $("#searchForm")[0].submit();
            return false;
        }
    </script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="list">字典列表</a></li>
		<@wolfking.hasPermission code="sys:dict:edit">
			<li><a href="edit?sort=10">字典添加</a></li>
		</@wolfking.hasPermission>
	</ul>
	<form id="searchForm" action="list"
		method="post" class="breadcrumb form-search">
		<input id="pageNum" name="pageNum" type="hidden" value="${page.pageNum}" /> 
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}" />
			<label>类型：</label> 
			<select id="type" name="type" class="input-medium">
				<option value="">请选择</option>
				<#list allType as type>  
				<option value="${type}" <#if type = dict.type!''> selected </#if>>${type}</option>
				</#list> 
			</select>&nbsp;&nbsp;
		<label>描述 ：</label> 
		<input type="text" name="description" maxlength="50" class="input-medium" value="${dict.description!''}"/> &nbsp;
		<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" />
	</form>
	<#include "/include/message.html">
	<table id="contentTable"
		class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>键值</th>
				<th>标签</th>
				<th>类型</th>
				<th>描述</th>
				<th>排序</th>
				<@wolfking.hasPermission code="sys:dict:edit">
					<th>操作</th>
				</@wolfking.hasPermission>
			</tr>
		</thead>
		<tbody>
			<#list page.list as dict>  
			<tr>
				<td>${dict.value!''}</td>
				<td><a href="edit?id=${dict.id}">${dict.label!''}</a></td>
				<td><a href="javascript:"
					onclick="$('#type').val('${dict.type}');$('#searchForm').submit();return false;">${dict.type!''}</a>
				</td>
				<td>${dict.description!''}</td>
				<td>${dict.sort!''}</td>
				<@wolfking.hasPermission code="sys:dict:edit">
					<td><a href="edit?id=${dict.id!''}">修改</a> 
					    <a href="delete?id=${dict.id!''}&type=${dict.type!''}" onclick="return confirmx('确认要删除该字典吗？', this.href)">删除</a> 
						<a href="eidt?type=${dict.type!''}&sort=${dict.sort!''}'">添加键值</a>
					</td>
				</@wolfking.hasPermission>
			</tr>
			</#list> 
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>